home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Wayzata's Best of Shareware PC/Windows 1
/
Wayzata's Best of Shareware for PC-Windows - Release 1 - Wayzata Technology (1993).iso
/
mac
/
DOS
/
EDITORS
/
STAT10
/
STAT.DOC
< prev
next >
Wrap
Text File
|
1992-08-26
|
16KB
|
344 lines
NOTE: THIS FILE CONTAINS LINES OVER 80 CHARACTERS. IF YOU TRY TO EXAMINE
THIS FILE WITH SOME SOFTWARE, THE LONG LINES WILL WRAP AROUND AND BE HARD
TO READ.
STAT by Kirk Barrett Software Engineering copyright 1992
STAT is a program which reads a text file containing columns of numbers and
calculates statistics on them (count, sum, average, standard deviation,
last value, maximum, minimum, range and line number of maxium and minimum),
based on specifications in a control file, and writes the results to an
output file.
QUICK START FOR THOSE WHO WON'T READ A FOUR PAGE MANUAL
Look at the sample input, control and output files. You should be able to
figure out the control file from the example. To create a new control
file, copy the sample to a new name and edit it. Execute the program by
typing the following from the DOS prompt:
STAT <control file>
EXPLANATION OF SHAREWARE
This program is Shareware. It is not free. If, after trying out the
program, you decide to continue to use it, you are obligated to purchase
the program for $10 from the program's author, Kirk Barrett Software
Engineering, by completing and mailing the following registration form.
Your support is important and greatly appreciated. With it, Shareware
authors are encouraged to design and distribute new products. Without it,
a great deal of high quality, low cost software will cease to be available.
You are encouraged to copy the programs WITH supporting files and share
them freely with others. You have the luxury of trying out the complete
programs, at your own pace and in the comfort of your own home or
workplace. This is not a crippled or "demo" copy, but the complete working
version of the program.
Why you should pay:
* You will receive a disk with our two other shareware programs,
APPNDLXL and 123IMPRT, plus a bunch of freeware (see below for a more
thorough explanation)
* Technical support - via mail or Compuserve
* Notification of updates and new products
* Inexpensive upgrade offers or other deals for registered users only
* Your input and ideas help shape future products
* A sense of pride and ownership, in having honestly participated in the
Shareware revolution
* You help to keep software prices down, by supporting a
distribution method which doesn't rely on expensive advertising
campaigns.
Be aware of the following restrictions, designed to protect the community
of Shareware users and authors, and to prevent greedy people from taking
unfair advantage of the trust, hard work, and good will of Shareware
authors:
1. No price or other consideration may be charged for distribution.
However, a distribution cost may be charged for the cost of the diskettes,
shipping, and handling, not to exceed $7 total (equivalent U.S. dollars).
2. The files and programs on the disks may not be modified nor deleted.
3. The programs cannot be sold as part of some other more inclusive
package.
4. The programs cannot be "rented" or "leased" to others.
WARRANTY
There is no warranty of any kind, and the copyright owner is not liable for
damages of any kind. By using this software, you agree to these terms.
The software and documentation are copyright 1992 by
Kirk Barrett Software Engineering
179 Westgate Dr.
Elgin, IL 60123
SHAREWARE SOFTWARE BY KIRK BARRETT SOFTWARE ENGINEERING
123IMPRT-- reads a text file and creates a Lotus-importable file (a "comma
and quote delimited" file) according to a template which you specify.
Works much better than the PARSE command in LOTUS or other spreadsheets.
PARSE-- "quick and dirty" way to create a Lotus-importable file.
APPDNLXL-- APPNDLXL reads up to 10 text files and appends them "line by
line", with several options, into a new output file. It is useful for
manipulating columnar reports. For example, you could merge two day-by-day
reports into one file, extracting only the columns of interest, or you
could rearrange or delete columns within one report.
STAT-- reads a text file containing columns of numbers and computes
statistics on them (sum, average, standard deviation, count, maximum and
minimum).
If you purchase any of these products, you will receive unregistered copies
of the others, plus the following for FREE:
o READSCRN-- reads the current screen and saves it to a file.
o LASRHELP-- a package of batch files which facilitates control
over a HP Laser Jet (set margins, orientation, lines per inch,
lines per page and more).
o ASCII-- displays all characters and their ASCII codes on one
screen.
o GRAFCHAR-- displays all graphic characters and their ASCII codes
in an easy-to-read format.
o FIXFILE-- reads any input file and replaces all non-text
characters with blanks.
STAT Registration Form
Copyright (c) 1992, Kirk Barrett Software Engineering
Please make checks payable and mail to:
Kirk R. Barrett
179 Westgate Dr.
Elgin, IL
STAT Registration Fee: $10
Name: _____________________________________________
Company Name: _____________________________________________
Mailing Address
Street: _____________________________________________
Town, State & Zip: _____________________________________________
Phone: ____________________________________________
Do you have a modem? ______________ Disk format ____ 3.50"
____ 5.25"
Where did you receive STAT from? (Just curious.)
Any comments or suggestions for this or other programs?:
EXPLANATION OF STAT
STAT is a program which reads a text file containing columns of numbers and
calculates statistics on them (count, sum, average, standard deviation,
last value, maximum, minimum, range and line number of maxium and minimum).
The results are written to an output file. A third file, called the
control file, specifies which statistics you want calculated and the
columns in which the numbers will appear in the input file.
You run the program from the DOS prompt by entering
STAT <control file>
You should create the control file in a text editor or word processor,
saving it as a text or ASCII file. Let me present a sample input file,
control file and output file first, and then explain the lines in the
control file one by one.
SAMPLE INPUT FILE
(The first two rows of numbers are not part of the file; they are provided
as a guide to determine the columns devoted to each field.)
1 2 3 4 5
12345678901234567890123456789012345678901234567890
Hi Lo
Rainfall Temperature Temperature
Day inches Deg F Deg F
07/01/91 80 60
07/02/91 81 61
07/03/91 0.5 78 58
. . . .
. . . .
. . . .
07/27/91 0.3 91 71
07/28/91 85 65
07/29/91 75 55
07/30/91 73 53
07/31/91 71 51
SAMPLE CONTROL FILE
1 1 1 1 1 1 1 1 1
1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
INPUT FILE weather.txt
OUTPUT FILE output
START LINE 4
END LINE
NUM HEADERS 3
Hi Lo
Rainfall Temp Temp
inches Deg F Deg F
STATISTIC SPECIFICATIONS
* Start Field Low Hi Multi- |--Last--| |Line# of| |Line# of|
* Col Width Threshold Threshold plier Constant|--Count-||---Sum--||---Avg--||-StdDev-||-Value--||-Maximum||-Maxium-||-Minimum||-Minimum||--Range-|
Rainfall 14 7 ###,### #####.## #####.## #####.## ####,### #####.## ####,### #####.##
Hi Temp 25 7 ###,### #####.## #####.## ######## ######## ####,### ######## ####,### ########
Lo Temp 38 7 ###,### #####.## #####.## ######## ######## ####,### ######## ####,### ########
DONE
SAMPLE OUTPUT FILE
1 2 3 4 5 6
123456789012345678901234567890123456789012345678901234567890
Hi Lo
Rainfall Temp Temp
inches Deg F Deg F
Count: 8 31 31
Sum: 4.50
Average: 83.19 63.19
Std Dev: 7.27 7.27
Last Value: 0.30 71 51
Max: 1.20 95 75
Line # of Max: 22 18 18
Min: 0.20 69 49
Line # of Min: 8 17 17
Range: 1.00 26 26
EXPLANATION OF THE CONTROL FILE
The general format for a line in the control file is a keyword in columns
1-20 and a data item starting in column 21. The lines MUST appear in the
order shown in the sample. Blank lines and comment lines (lines beginning
with a "*") can appear anywhere in the control file.
The first line in the control file specifies the input file, ie, the text
file with columns of numbers. The second line specifies, the output file,
ie, file to which the statistics will be written. The next two lines
specify the line number in the input file at which to start and end
calculation of the statistics. If you want to include all the lines
through the end of the file, leave the end line value field blank.
Specifying a start line of other than 1 or a non-blank end line allows you
to calculate statistics on only part of a file.
The next line specifies the number of header lines you want to write at the
top of the output file. The statistics for a column in the input file will
be written in a vertically aligned columned in the output file. Columns
1-20 in the output file are reserved for statistic descriptions. Therefore,
you should specify headers for the statistic columns beginning in column
21. Each statistic in the output file will be right-justified in a 10
character wide field, so the column header should also be right justified
in a 10-character field. Refer to the samples above and the discussion
below on "statistic specification" and output lines for more explanation.
Immediately following the "NUM HEADERS" line, you should include the actual
headers lines that will go into the output file.
Following the header lines comes a line containing only the keyword
STATISTIC SPECIFICATIONS. Following this line, comes an indefinite number
of "statistic specification" lines, each line specifying a field in the
input file and the statistics to calculate on this field.
FIELDS IN THE STATISTIC SPECIFICATION LINES
Each line starts with a field description in columns 1-20. This
description is not used by the program. The rest of the line contains a
number of fields, starting in column 21 and continuing through column 180,
with each field 10 columns wide. You may have to issue some special
formatting commands to accommodate a line 180 columns long in your text
editor or word processor.
The next two fields of the statistic specification line specify the column
(ie, number of characters from the start of the line) in which the column
of numbers starts in the input file, and the field width (in number of
characters).
The next two fields specify a high and low threshold for values to be
included in the statistics. If a value in the input file for this field is
outside these thresholds, it will not be included in the statistic
calculations. If you want to include all values, leave the threshold
fields blank.
The next two fields specify a multiplier and a constant which allow you to
convert the input values to a different unit. The value in the input file
will be multiplied by the multiplier and then the constant will be added to
the result. For example, if your input file contained a column of
temperature in centigrade and you wanted to convert to Fahrenheit, you
would specify a multiplier of 1.8 and a constant of 32. If you do not want
to convert the values, leave the multiplier and constant fields blank.
Next comes a series of fields which specify which statistics you want to
calculate for this column. If a field is left blank, then the statistic
will not be calculated for this column. If you do want the statistic
calculated, you should "activate" it by specifying the format in which you
want the value to appear in the output file. The format is specified as in
the BASIC programming language. Put a pound sign (#) for each digit you
want printed. You can also include commas and a dollar sign. For example,
if you estimate the value of the statistic would be about to 10,000 and you
wanted 2 digits to the right of the decimal point, you would specify the
format as ##,###.##. The format should be right justified in the field.
Include a statistic specification line for each column in the input file on
which you want to calculate statistics. End the series of statistic
specification lines with a line containing DONE in columns 1-4.
OUTPUT FILE
The output file begins with the header lines that were specified in the
control file. These are followed by the statistics themselves, one
statistic per line. Each line begins with a statistic description in
columns 1-20. The statistics themselves appear in 10-character wide fields
starting in column 21. If a statistic was not "activated" (ie, the field
was left blank in the statistic specification line), then the statistic
field will be left blank (eg, in the samples above, for rainfall, average
and standard deviation were not activated, so these field were left blank
in the rainfall column of the output file).
The columns in the output file appear in the same order as the statistic
specification lines appear in the control file.
If a line in the input file contains a non-numeric value or all blanks,
then the value will not be included in the calculation of the count,
average or standard deviation of that column.
CREATING A CONTROL FILE
The best way to create a control file is to copy an old control file to a
new name and then edit the new file. Since any lines after the "DONE" line
are ignored, you can include a small portion of the input file at the
bottom of the control file to help you determine the starting column and
field width of the fields in the input file.
EXAMPLE FILES
The above example files are included as CONTROL, WEATHER.TXT and OUTPUT.